//
//  JSWebViewController.m
//  HTML_CSS_JS
//
//  Created by fans on 16/5/24.
//  Copyright © 2016年 FF. All rights reserved.
//

#import "JSWebViewController.h"
#import "TestBridge.h"

@interface JSWebViewController ()<UIWebViewDelegate>

@property (weak, nonatomic) IBOutlet UIWebView *mWebView;
@property (strong, nonatomic) TestBridge * bridge;

@end

@implementation JSWebViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIWebView *wm = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 640 )];
    [self.view addSubview:wm];
//    _bridge = [TestBridge bridgeForWebView:self.mWebView webViewDelegate:self];
    _bridge = [TestBridge bridgeForWebView:wm webViewDelegate:self];
    NSURL *baseURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]];
    NSString * htmlPath = [[NSBundle mainBundle] pathForResource:@"ExampleApp" ofType:@"html"];
    NSString * appHtml = [NSString stringWithContentsOfFile:htmlPath encoding:NSUTF8StringEncoding error:nil];
//    self.mWebView.delegate = self;
    [wm loadHTMLString:appHtml baseURL:baseURL];
    
    [self.view setBackgroundColor:[UIColor whiteColor]];
}



@end
